package com.ship.dispatch.mapper.fob;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ship.dispatch.bean.fob.SpFobTemplate;
import com.ship.dispatch.model.Vo.SpArrangeVo;
import com.ship.dispatch.model.dto.SpArrangePageDto;
import com.ship.dispatch.model.dto.fileTemplate.SpFobFileTemplateDto;
import com.ship.dispatch.model.dto.fileTemplate.SpFobTemplateDto;
import com.ship.dispatch.vo.fileTemplate.SpFobFileTemplateListVO;
import com.ship.dispatch.vo.fileTemplate.SpFobTemplateListVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 *@title SpFobTemplateMapper
 *@description
 *@author yl
 *@create 2023/12/16 0016
 */

public interface SpFobTemplateMapper extends BaseMapper<SpFobTemplate> {
    @Select("select * from con_shipping_agency where (status=1 or status=2 or status=3) and del_apply!=2")
    List<Map<String, Object>> selectCronInfo();

    @Select("select * from con_resource_main where (status=1 or status=2 or status=3) and del_apply!=2")
    List<Map<String, Object>> selectMACronInfo();
    @Select("select * from con_third_party_measurement where (status=1 or status=2 or status=3) and del_apply!=2")
    List<Map<String, Object>> selectConThirdPartyMeasurementInfo();

    Page<SpFobTemplateListVO> getPage(Page page, @Param(value = "dto") SpFobTemplateDto pageDto);

    Page<SpFobTemplateListVO> getFilePage(Page page, @Param(value = "dto") SpFobFileTemplateDto pageDto);

    List<SpFobFileTemplateListVO> getExportInfo(@Param("dto") SpFobFileTemplateDto pageDto, @Param("ids") List<String> ids);

    @Select("SELECT id FROM sp_fob_template WHERE template_name = #{templateName}")
    Long getIdByTemplateName(@Param("templateName") String templateName);

    @Select("select * from con_insurance_people where  NOW()<=expiration_date and (status=1 or status=2 or status=3) and del_apply!=2")
    List<Map<String, Object>> selectConInsurancePeople();
    @Select("select * from con_insurance_goods where  NOW()<=expiration_date and (status=1 or status=2 or status=3) and del_apply!=2")
    List<Map<String, Object>> selectConInsuranceGoods();
}
